package com.zodiac.alioth.web.exception;

/**
 * Created by zhouyao on 2018/7/13.
 */
public class ServiceException extends RuntimeException {
    private String errorCode;
    private String errorMessage;

    public ServiceException() {}

    public ServiceException(String errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    /*public ServiceException(HeaderEnum header) {
        this.errorCode = header.getErrorCode();
        this.errorMessage = header.getErrorMessage();
    }*/


    /*public ServiceException(Throwable cause) {
        if (cause instanceof ServiceException){
            ServiceException serviceException = (ServiceException) cause;
            this.errorMessage = serviceException.getErrorMessage();
            this.errorCode = serviceException.getErrorCode();
        }
    }*/

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
